import { http } from "@/utils/http";
interface CooperationInfo {
  type: string,
  liveTime: string,
  name: string,
  mcnName: string,
  gameType: string,
  liveNumber: string,
  liveType: string,
  numberId: string,
  position: string,
  anchorCount: string,
}
/**
 * 给出可选的mcn机构列表
 * @param data 
 * @returns 
 */
export const updateCooperationInfo = (data: CooperationInfo) => {
  return http.request("post", "/platform/getMcnList", { data });
}

interface McnListResult { }
/**
 * 给出可选的mcn机构列表
 * @param data 
 * @returns 
 */
export const getMcnList = () => {
  return http.request<McnListResult>("post", "/platform/getMcnList");
}
interface BindingInfo {
  type: 0 | 1,
  mcn_id?: number
}
/**
 * 主播绑定/解绑 机构操作调用
 * @param type 1: 解绑 0: 绑定
 * @returns 
 */
export const bindingMCN = (data: BindingInfo) => {
  return http.request("post", "/platform/baningMcn", { data });
}


export interface AnchorInfoBase {

  /**
   * 是否同意主播合作协议 0 不同意 1同意
   */
  agree?: 0 | 1;
  /**
   * 擅长的游戏类型1-6
   */
  game_type?: string | number;
  /**
   * 省份证信息
   */
  IdNumber: number | string;
  /**
   * 直播时长选项1-5
   */
  live_time?: string | number;
  /**
   * 直播房间号
   */
  liveNumber?: string | number;
  /**
   * 直播平台id 1-7
   */
  livePlatformId?: string | number;
  /**
   * 主播名字 7汉字内
   */
  relName?: string;
  /**
   * 手机号
   */
  tellphone?: string | number;
  /**
   * 1 主播  2是解说
   */
  type: number;
  [prop: string]: any
}
/**
 * 申请主播信息
 * @param data 
 * @returns 
 */
export const applayAnchor = (data: AnchorInfoBase) => {
  return http.post("/cooperate/apply.anchor", { data });
}






export interface AnchorApplayInfo extends Omit<CooperationInfo, "type" | 'agree'> {

  /**
   * 审核状态1 审核中 2 已审核 3未通过
   */
  state: 1 | 2 | 3;
  /**
   * 申请类型:0默认 1 主播 2解说
   */
  verifyType: 0 | 1 | 2
}

/**
 * 给出主播的申请信息
 * @returns 
 */
export const getAnchorApplayInfo = () => {
  return http.get<AnchorApplayInfo>('/cooperate/get.anchor')
}